package com.woniu.aimd.controller;

import com.woniu.aimd.pojo.entity.Wronganswerquestion;
import com.woniu.aimd.pojo.entity.Wrongchoicequestion;
import com.woniu.aimd.service.impl.MyWAnswerQImpl;
import com.woniu.aimd.service.impl.MyWChoiceQImpl;
import com.woniu.aimd.service.impl.MychoicequestionImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("myquestions")
public class MyWQuestionsController {
    @Autowired
    MyWChoiceQImpl myWChoiceQ;
    @Autowired
    MyWAnswerQImpl myWAnswerQ;
    @Autowired
    MychoicequestionImpl mychoicequestion;
    @RequestMapping("choiceQ")
    public List<Wrongchoicequestion> getMyWChoiceQuestions(String user_id ,Integer status) {
       return myWChoiceQ.MyWChoiceQ(user_id, status);
    }
    @RequestMapping("answerQ")
    public List<Wronganswerquestion> getMyWAnswerQuestions(String user_id, Integer status) {
        return myWAnswerQ.MyWAnswerQ(user_id, status);
    }
    @DeleteMapping("deleteMyWAnswerQ")
    public void deleteMyWAnswerQ(int id) {
        myWAnswerQ.deleteMyWAnswerQ(id);
    }
    @DeleteMapping("deleteMyWChoiceQ")
    public void deleteMyWChoiceQ(@RequestParam int id) {
        myWChoiceQ.deleteMyWChoiceQ(id);
    }

}
